#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

struct sfs
{
	int x,y;
	double dis;
	char ok;
}dd[10005];


int n;
double totx, toty;

//*/
int cmp(const void *a,const void *b)
{
	struct sfs *t1,*t2;
	t1=(struct sfs *)a;
	t2=(struct sfs *)b;
	if (t1->x > t2->x) return 1;
	if (t1->x < t2->x) return -1;
	if (t1->y > t2->y) return 1;
	if (t1->y < t2->y) return -1;	
	return 0;
}//*/

int findone(int a)
{
	int tox,toy;
	int head,tail,mid;
	tox=totx+totx-dd[a].x;
	toy=toty+toty-dd[a].y;
	head=1;
	tail=n;
	while (head<=tail)
	{
		mid=(head+tail)/2;
		if (tox>dd[mid].x)
		{
			head=mid+1;
		}
		else if (tox<dd[mid].x)
		{
			tail=mid-1;
		}
		else
		{
			if (toy>dd[mid].y) head=mid+1;
			else if (toy<dd[mid].y) tail=mid-1;
			else return mid;
		}
	}
	
	return -1;
}

main()
{
	int ncase,i,j,yes;
	scanf("%d", &ncase);
	while (ncase-->0)
	{
		memset(dd,0,sizeof(dd));
		totx=toty=0;
		scanf("%d", &n);
		for (i=1;i<=n;i++)
		{
			scanf("%d%d", &dd[i].x, &dd[i].y);
			totx+=dd[i].x;
			toty+=dd[i].y;
		}
		totx=totx/n;
		toty=toty/n;
		for (i=1;i<=n;i++)
			dd[i].dis=(dd[i].x-totx)*(dd[i].x-totx)+(dd[i].y-toty)*(dd[i].y-toty);

		qsort(dd+1,n,sizeof(struct sfs),cmp);
//		for (i=1;i<=n;i++)
//			printf("x=%d, y=%d\n", dd[i].x,dd[i].y);

		yes=1;
		for (i=1;i<=n;i++)
		{
			if (dd[i].ok==0)
			{
				j=findone(i);
				if (j==-1) 
				{
					yes=0;
					break;
				}
				dd[i].ok=1;
				dd[j].ok=1;
			}
		}
	
		if (yes) printf("yes\n");
		else printf("no\n");
	}

	return 0;
}

